/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gruppe1projekt.ModelLayer;

import java.util.ArrayList;

/**
 *
 * @author Moulde
 */
public class Customer extends Actor
{
    private int TotalSpent;
    private ArrayList<DiscountGroup> DiscountGroups;

    public Customer(String FullName, String Adress, String City, String Country, String State, String ZipCode)
    {
        super(FullName, Adress, City, Country, State, ZipCode);
        this.DiscountGroups = new ArrayList<DiscountGroup>();
    }

    public Customer()
    {
        super();
        this.DiscountGroups = new ArrayList<DiscountGroup>();
    }

    public ArrayList<DiscountGroup> getDiscountGroups()
    {
        return DiscountGroups;
    }

    public void setDiscountGroups(ArrayList<DiscountGroup> DiscountGroups)
    {
        this.DiscountGroups = DiscountGroups;
    }

    public void addDiscountGroup(DiscountGroup discount)
    {
        this.DiscountGroups.add(discount);
    }

    public double CalculateDiscount()
    {
        double tempDiscount = 0;
        for (DiscountGroup discountGroup : DiscountGroups)
        {
            tempDiscount += discountGroup.getPercentageDiscount();
        }

        if(tempDiscount > 20)
            tempDiscount = 20;
        
        return tempDiscount;
    }

    public int getTotalSpent()
    {
        return TotalSpent;
    }
    
    public void setTotalSpent(int TotalSpent)
    {
        this.TotalSpent = TotalSpent;
    }

    public void addTotalSpent(int toAdd)
    {
        this.TotalSpent += toAdd;
    }
}